can't delete folder created with Robocopy  (solution provided)
I thought to share, perhaps can save someoene else an hour or 2...I had a pickle of a time deleting a destination folder on my drive thatI created by an incorrect syntax of robocopy.here is whatI ran:robocopy "c:\sourcefolder" "d:\destfolder /s /e"Notice that i put the quote AFTER the /s /e options, (correct syntax should have been: robocopy "c:\sourcefolder" "d:\destfolder" /s /eIf you run that though, (with the wrong syntax), you get a folder on the destination side that you can NOT delete. (not from explorer, command prompt, etc..)After an hour or so of chkdsk's,lots of rmdir, re-applying permissions,installing unlockers, rebooting into safeomde, etc.. I finally figured it out.You have to type from the command prompt:rmdir /s "d:\destfolder /"Hope this helps someone.-E
November 13th, 2009 8:01am

You diamond! I've been battling with this for ages. I can't confirm the incorrect syntax I originally used with Robocopy but the rmdir command line you gave deleted my "un-deletable" folder straight away - and this was on Server 2008 R2 standard. Further to the above I had a folder in the same directory with an identical name with 19GB of data in it, this was untouched by the command so I'm very happy. Thanks again Steve
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2010 6:26pm

I tried every solution I could find on the internet to delete corrupted directories in XP Home: none worked. This included checking permissions, checking long path names, booting in Safe Mode and running DOS commands rmdir /s, chkdsk, subst, changing attributes, etc. I finally found Robocopy which is provided free by Microsoft in their "Windows Resource Kits". In order to get Robocopy to work I created a new directory "JUNK" on the C: dirve with nothing in the directory. The JUNK directory was used as the SOURCE directory for the Robocopy command and the directories I could not delete were one and two levels below the "CORRUPT" DESTINATION directory. I entered the following command at the DOS prompt: robocopy C:\JUNK C:\CORRUPT /E /PURGE Problem solved. Robocopy copied nothing to the DESTINATION folder but it did purge the corrupted directories. The /E switch may not be necessary but I used it anyway. Chuck Stephens
August 24th, 2010 3:25am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics